/**
 */
package gatperdut.chato.model.Chato.Item.impl;

import gatperdut.chato.model.Chato.Item.GenericBoxInventory;
import gatperdut.chato.model.Chato.Item.ItemPackage;

import gatperdut.chato.model.Chato.Util.Lock;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Generic Box Inventory</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link gatperdut.chato.model.Chato.Item.impl.GenericBoxInventoryImpl#isOpen <em>Open</em>}</li>
 *   <li>{@link gatperdut.chato.model.Chato.Item.impl.GenericBoxInventoryImpl#isClosable <em>Closable</em>}</li>
 *   <li>{@link gatperdut.chato.model.Chato.Item.impl.GenericBoxInventoryImpl#getLock <em>Lock</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public abstract class GenericBoxInventoryImpl extends GenericInventoryImpl implements GenericBoxInventory {
    /**
     * The default value of the '{@link #isOpen() <em>Open</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #isOpen()
     * @generated
     * @ordered
     */
    protected static final boolean OPEN_EDEFAULT = true;

    /**
     * The default value of the '{@link #isClosable() <em>Closable</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #isClosable()
     * @generated
     * @ordered
     */
    protected static final boolean CLOSABLE_EDEFAULT = false;

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    protected GenericBoxInventoryImpl() {
        super();
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    protected EClass eStaticClass() {
        return ItemPackage.Literals.GENERIC_BOX_INVENTORY;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public boolean isOpen() {
        return (Boolean)eDynamicGet(ItemPackage.GENERIC_BOX_INVENTORY__OPEN, ItemPackage.Literals.GENERIC_BOX_INVENTORY__OPEN, true, true);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setOpen(boolean newOpen) {
        eDynamicSet(ItemPackage.GENERIC_BOX_INVENTORY__OPEN, ItemPackage.Literals.GENERIC_BOX_INVENTORY__OPEN, newOpen);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public boolean isClosable() {
        return (Boolean)eDynamicGet(ItemPackage.GENERIC_BOX_INVENTORY__CLOSABLE, ItemPackage.Literals.GENERIC_BOX_INVENTORY__CLOSABLE, true, true);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setClosable(boolean newClosable) {
        eDynamicSet(ItemPackage.GENERIC_BOX_INVENTORY__CLOSABLE, ItemPackage.Literals.GENERIC_BOX_INVENTORY__CLOSABLE, newClosable);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public Lock getLock() {
        return (Lock)eDynamicGet(ItemPackage.GENERIC_BOX_INVENTORY__LOCK, ItemPackage.Literals.GENERIC_BOX_INVENTORY__LOCK, true, true);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetLock(Lock newLock, NotificationChain msgs) {
        msgs = eDynamicInverseAdd((InternalEObject)newLock, ItemPackage.GENERIC_BOX_INVENTORY__LOCK, msgs);
        return msgs;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setLock(Lock newLock) {
        eDynamicSet(ItemPackage.GENERIC_BOX_INVENTORY__LOCK, ItemPackage.Literals.GENERIC_BOX_INVENTORY__LOCK, newLock);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
        switch (featureID) {
            case ItemPackage.GENERIC_BOX_INVENTORY__LOCK:
                return basicSetLock(null, msgs);
        }
        return super.eInverseRemove(otherEnd, featureID, msgs);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public Object eGet(int featureID, boolean resolve, boolean coreType) {
        switch (featureID) {
            case ItemPackage.GENERIC_BOX_INVENTORY__OPEN:
                return isOpen();
            case ItemPackage.GENERIC_BOX_INVENTORY__CLOSABLE:
                return isClosable();
            case ItemPackage.GENERIC_BOX_INVENTORY__LOCK:
                return getLock();
        }
        return super.eGet(featureID, resolve, coreType);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public void eSet(int featureID, Object newValue) {
        switch (featureID) {
            case ItemPackage.GENERIC_BOX_INVENTORY__OPEN:
                setOpen((Boolean)newValue);
                return;
            case ItemPackage.GENERIC_BOX_INVENTORY__CLOSABLE:
                setClosable((Boolean)newValue);
                return;
            case ItemPackage.GENERIC_BOX_INVENTORY__LOCK:
                setLock((Lock)newValue);
                return;
        }
        super.eSet(featureID, newValue);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public void eUnset(int featureID) {
        switch (featureID) {
            case ItemPackage.GENERIC_BOX_INVENTORY__OPEN:
                setOpen(OPEN_EDEFAULT);
                return;
            case ItemPackage.GENERIC_BOX_INVENTORY__CLOSABLE:
                setClosable(CLOSABLE_EDEFAULT);
                return;
            case ItemPackage.GENERIC_BOX_INVENTORY__LOCK:
                setLock((Lock)null);
                return;
        }
        super.eUnset(featureID);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public boolean eIsSet(int featureID) {
        switch (featureID) {
            case ItemPackage.GENERIC_BOX_INVENTORY__OPEN:
                return isOpen() != OPEN_EDEFAULT;
            case ItemPackage.GENERIC_BOX_INVENTORY__CLOSABLE:
                return isClosable() != CLOSABLE_EDEFAULT;
            case ItemPackage.GENERIC_BOX_INVENTORY__LOCK:
                return getLock() != null;
        }
        return super.eIsSet(featureID);
    }

} //GenericBoxInventoryImpl
